const { default: createKnex } = require('knex');

const knex = createKnex({
  client: 'mysql',
  version: '5.7',
  connection: {
    host: process.env.MYSQL_HOST,
    port: 3306,
    user: process.env.MYSQL_USER,
    password: process.env.MYSQL_PASSWORD,
    database: 'CHANNEL_DEMO',
  },
});

const prefix = 'channel_demo_ess';

module.exports.knex = knex;
module.exports.prefix = prefix;


module.exports.TABLE_NAME = {
  user: `${prefix}_user`,
  worker: `${prefix}_worker`,
  tenant: `${prefix}_tenant`,
  organization: `${prefix}_organization`,
  contract: `${prefix}_contract`,
  notice: `${prefix}_notice`,
  send: `${prefix}_send`,
  settings: `${prefix}_settings`,
  tenantSignRecord: `${prefix}_tenantSignRecord`,
  workerSignRecord: `${prefix}_workerSignRecord`,
};
